from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver import ActionChains
d = webdriver.Chrome()
d.get('https://www.qq.com')
d.maximize_window()
time.sleep(2)

# 1、先定位到更多
a = d.find_element(By.CSS_SELECTOR, '[class="more-txt"]')
# 2、移动到更多上面   ActionChains(浏览器名称).move_to_element(移动到哪个元素).perform()
ActionChains(d).move_to_element(a).perform()
time.sleep(2)
# 点击天气
b = d.find_element(By.LINK_TEXT, '天气')
b.click()
time.sleep(3)

d.quit() # 关闭所有窗口
